<?php if (!defined('insite')) die("no access");  
require "opt.php";
$content = new content();
$content->set('|forgot_title|', forgot_title);
$content->out_content("theme/".$config["theme"]."/them/forgotpwd_h.them");


if (!$_REQUEST["okchange"])
 {
	$content->set('|forgot_login|', forgot_login);
	$content->set('|forgot_mail|', forgot_mail);
	$content->set('|forgot_word|', forgot_word);
	$content->set('|session_name|', session_name());
	$content->set('|session_id|', session_id());
	$content->set('|forgot_okptn|', forgot_okptn);
	$content->out_content("theme/".$config["theme"]."/them/forgotpwd_c.them");
}
 else
 {
	
	$captch = validate(substr($_POST["fcaptch"],0,7));

	if(isset($_SESSION['captcha_keystring']))
	{
		if($_SESSION['captcha_keystring'] == $captch)
		{
			unset($_SESSION['captcha_keystring']);
			$reclogin = validate(substr($_POST["flogin"],0,10));
			$recmail = checkwordm(substr($_POST["fmail"],0,20));
			$recword = validate(substr($_POST["fword"],0,20));
			$result = mssql_fetch_row(mssql_query("SELECT recpwd FROM memb_info WHERE memb___id='".$reclogin."' and mail_addr='".$recmail."' and fpas_answ='".$recword."'"));
			if($result[0]){echo"<tr><td align='center'>".forgot_msg."</td><td class='succes' align='center'>$result[0]</td></tr>";}
			else{echo"<div class='warnms'>".forgot_no_pwd."</div>";}
		}
		else{echo"<div class='warnms'>Captcha error!</div>";}	
	}
 }
$content->out_content("theme/".$config["theme"]."/them/forgotpwd_f.them"); 